package com.t114514.demo.service.impl;

import com.t114514.demo.mapper.TeacherMapper;
import com.t114514.demo.pojo.Teacher;
import com.t114514.demo.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public Teacher findTeacher(String teacherAccount) {
        return teacherMapper.selectTeacher(teacherAccount);
    }

    @Override
    public Teacher findTeacher(int teacherId) {
        return teacherMapper.selectByTeacherId(teacherId);
    }

    @Override
    public void addTeacher(String teacherAccount, String password,String teacherName) {
        teacherMapper.insertTeacher(teacherAccount, password,teacherName);
    }

    @Override
    public void modifyTeacher(Teacher teacher) {
        teacherMapper.updateTeacher(teacher);
    }
}
